package com.weiyuwqj.api.model.vo;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import com.weiyuwqj.api.exception.CrowdException;
import com.weiyuwqj.api.model.SysAssetProduct;
import com.weiyuwqj.api.util.StringUtils;

/**
 * 
 * @className:SysAssetProductVo	
 * @Description: 资产方vo
 * @author cx
 * @date:2017年3月25日下午3:28:30 
 *
 */
public class SysAssetProductVo extends SysAssetProduct implements Serializable{

	private static final long serialVersionUID = -3470776392429665415L;
	
	/**
	 * 产品方名
	 */
	private String companyName;
	
	/**
	 * 标名称
	 */
	private String itemName;
	/**
	 * 资金安全
	 */
	private String fundSecurity;
	/**
	 * 风控措施
	 */
	private String riskControlMeasures;
	
	/**
	 * 剩余押金额度
	 */
	private double depositAmount;

	/**
	 * 是否可债转:0.不可债转 1.可债转
	 */
	private Integer debtTransferable;
	/**
	 * 是否推荐标：0-否 1-推荐
	 */
	private Integer itemIsrecommend;
	/**
	 * 是否新手标：0-普通，1-新手标
	 */
	private Integer itemIsnew;
	/**
	 * 结束时间
	 */
	private Date endTime;

	/**
	 * 债权手续费率
	 */
	private BigDecimal debtServeFeeRate;
	
	/**
	 * 资产图片列表
	 */
	private List<String> picList;

	private String username;

	public BigDecimal getDebtServeFeeRate() {
		return debtServeFeeRate;
	}

	public void setDebtServeFeeRate(BigDecimal debtServeFeeRate) {
		this.debtServeFeeRate = debtServeFeeRate;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	/**
	 * 校验
	 */
	public void validData(){
		if(this.getCompanyId()==null||this.getCompanyId()<=0){
			throw new CrowdException("sys.asset.company.id.not_exists");
		}
		if(StringUtils.isNull(this.getName())){
			throw new CrowdException("sys.asset.product.name.not_exists");
		}
		if(this.getAmount()<=0){
			throw new CrowdException("sys.asset.product.amount.lt.zero");
		}
		if(StringUtils.isNull(this.getApr())){
			throw new CrowdException("sys.asset.product.apr.not_exists");
		}
		if(this.getTimeLimit()<=0){
			throw new CrowdException("sys.asset.product.time_limit.lt.zero");
		}
		if(this.getCycleUnit()<=0){
			throw new CrowdException("sys.asset.product.cycle_unit.lt.zero");
		}
		if(this.getRepayStyle()<=0){
			throw new CrowdException("sys.asset.product.repay_style.lt.zero");
		}
		if(StringUtils.isNull(this.getInterestTime())){
			throw new CrowdException("sys.asset.product.interest_time.not_exists");
		}
		if(StringUtils.isNull(this.getDescription())){
			throw new CrowdException("sys.asset.product.description.not_exists");
		}
	}

	public String getCompanyName() {
		return companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}

	public double getDepositAmount() {
		return depositAmount;
	}

	public void setDepositAmount(double depositAmount) {
		this.depositAmount = depositAmount;
	}

	public String getItemName() {
		return itemName;
	}

	public void setItemName(String itemName) {
		this.itemName = itemName;
	}

	public Integer getDebtTransferable() {
		return debtTransferable;
	}

	public void setDebtTransferable(Integer debtTransferable) {
		this.debtTransferable = debtTransferable;
	}

	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	public List<String> getPicList() {
		return picList;
	}

	public void setPicList(List<String> picList) {
		this.picList = picList;
	}

	/**资产图片类型**/
	private Integer picType;
	public Integer getPicType() {
		return picType;
	}
	public void setPicType(Integer picType) {
		this.picType = picType;
	}

	public String getFundSecurity() {
		return fundSecurity;
	}

	public void setFundSecurity(String fundSecurity) {
		this.fundSecurity = fundSecurity;
	}

	public String getRiskControlMeasures() {
		return riskControlMeasures;
	}

	public void setRiskControlMeasures(String riskControlMeasures) {
		this.riskControlMeasures = riskControlMeasures;
	}

	public Integer getItemIsrecommend() {
		return itemIsrecommend;
	}

	public void setItemIsrecommend(Integer itemIsrecommend) {
		this.itemIsrecommend = itemIsrecommend;
	}

	public Integer getItemIsnew() {
		return itemIsnew;
	}

	public void setItemIsnew(Integer itemIsnew) {
		this.itemIsnew = itemIsnew;
	}


}
